
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>

<?php
	
	//View Controller_Nganh 

	include('stdlib.php');
	include('Connect_DB.php'); //file include and Run connect Database.Dont move this file following
	include('Model.php');
	 
	$result = View_Nganh(); //Call function form file Model.php
	
	echo form_open("Quan ly nganh dao tao");
	echo '<h2><center> QUẢN LÝ NGÀNH ĐÀO TẠO </center></h2><br /><hr>';
	
	echo '<br />';
	
	//Link View Paginated
	echo "<center><p><a href='Paginated_Nganh.php?page=1'><b>Paginated View</b></a></center><br />";
	
	//View Form 
	echo tbl_open('100%', '2');
	echo tr(td('STT', '10%').td('Mã Ngành', '10%').td('Mã đơn vị', '10%').td('Tên viết tắt', '15%').td('Tên đầy đủ', '35%').td                           ('Sửa', '10%').td('Xóa', '10%'), 'center');

	$ci=1;
	while($row=mysql_fetch_array($result))
	{	
		$tmp ='<a href="Edit_Action_Nganh.php?id=' . $row['id'] . '">Edit</a>';
		$temp='<a href="Delete_Action_Nganh.php?id=' . $row['id'] . '">Delete</a>';
		echo tr(td($ci).td($row['maNganh']).td($row['maDonvi']).td($row['tenViettat']).td($row['tenDaydu']).td($tmp).td($temp),'center');
		$ci++;
	}
	echo tbl_close();
	echo form_close();
	
	echo'<br />';
	
	//View button "Add"
	echo '<form action="Add_View_Nganh.php?action=ADD" method="POST">';
	echo '<center><input type="submit" name="submit" value="ADD" /></center>';
	echo '</form>';
?>